import ReactDOM from 'react-dom/client'
import App from './App.tsx'
import './index.css'
import {BrowserRouter} from "react-router-dom";
import * as states from "@/redux/states"
import * as actions from "@/redux/actions"
import {connect, Provider} from "react-redux";
import store from "@/redux/index";

const mapState = (state = states) => ({...state})

const mapDispatch = (action = actions) => ({...action})
// TODO 只支持单页快更改
const AppContainer = connect(
    mapState,
    mapDispatch
)(App)


ReactDOM.createRoot(document.getElementById("root")).render(
    <BrowserRouter>
        <Provider store={store}>
            <AppContainer/>
        </Provider>
    </BrowserRouter>
);
